﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using NhanVien_Public;

namespace NhanVien_Data
{
  public  class nv_data
    {
      nv_public nv=new nv_public();
      KetNoiCSDL_Data kn = new KetNoiCSDL_Data();
      public DataTable loadAnh(string sql)
      {
         return kn.loadAnh(sql);
      }
      public DataTable taobang(string sql)
      {
          return kn.taobang(sql);
      }
      public DataTable LayDuLieu()
      {
          return kn.LayDuLieu("Load_NhanVien");
      }
      public int Insert(nv_public ten, nv_public anh)
      {
          int p = 2;
          string[] name = new string[p];
          object[] value = new object[p];
          name[0] = "@Ten";
          value[0] =  ten.TenNhanVien;
          name[1] = "@Anh"; 
          value[1] = anh.Anh;
          return kn.update("Insert_NhanVien", name, value, p);
      }
  
    }
}
